package cn.virens.common.project.base.uuid;

import cn.virens.common.util.core.uuid.UuidUtil;
import cn.virens.common.util.exception.APIException;
import org.springframework.beans.factory.annotation.Value;

public class UuidManageImpl implements UuidManage {

    @Value("${uuid.server.id}")
    private Long serverId;

    @Override
    public String generate() throws APIException {
        return UuidUtil.generate(serverId);
    }

    @Override
    public String generate(long id) throws APIException {
        return UuidUtil.generate(id);
    }
}
